<%-- 
    Document   : del
    Created on : Sep 10, 2014, 8:35:35 AM
    Author     : bean
--%>

<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Statement"%>
<%@page import="DAL.MyConnection"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            try {
                Connection con = MyConnection.getConnection();
                String id = request.getParameter("id");
                String selectQ = "DELETE FROM Stu WHERE id = '" + id + "'";
                Statement st = con.createStatement();
                ResultSet rs = st.executeQuery(selectQ);
                con.close();
                rs.close();
                st.close();
            } catch (SQLException ex) {
                out.println(ex.getMessage());
            }
            response.sendRedirect("list.jsp");
        %>
    </body>
</html>
